package io;

import java.io.*;

/**
 * 使用对象输入流进行对象的反序列化
 */
public class OISDemo {
    public static void main(String[] args) throws IOException,ClassNotFoundException{
        FileInputStream fis=new FileInputStream("person.obj");
        ObjectInputStream ois=new ObjectInputStream(fis);
        // 抛出异常得操作：alt+enter ，选第一项 add exceptiong
        Person p=(Person)ois.readObject();
        System.out.println(p);

        ois.close();

    }
}
